Carbon


GetIconRef

Header: Icons.h Carbon status: Supported

Provides an IconRef for an icon in the desktop database or for a registered icon.

OSErr GetIconRef (
    SInt16 vRefNum, 
    OSType creator, 
    OSType iconType, 
    IconRef *theIconRef
);
vRefNum

The volume where Icon Services should start to search for the desired icon. Pass the kOnSystemDisk constant if you are not sure which value to specify in this parameter.

creator

The creator code of the desired icon.

iconType

The type code of the desired icon.

theIconRef

On return, a pointer to the desired icon data.

function result

A result code.

DISCUSSION

Icon Services defines constants for commonly-used system icons. You can pass one of these constants in the iconType parameter if you specify kSystemIconCreator in the creator parameter. See “Folder Icon Constants” for a list of these constants.

Calling the GetIconRef function increments the reference count of the IconRef.

Remember to call the function ReleaseIconRef when you are done with an IconRef.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when IconServicesLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by IconServicesLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/18/2000)